<!DOCTYPE html>
<html class="x-admin-sm" xmlns:th="http://www.thymeleleaf.org">
<head th:insert="base">
    <meta charset="UTF-8">
    <title></title>
</head>
<body>
<div class="layui-fluid">
    <div class="layui-row">
        <form class="layui-form" action="" method="post">
            <input type="hidden" id="orderId" name="orderId" th:value="${orderId}"/>
            <input type="hidden" id="evaluateDir" name="evaluateDir" th:value="${evaluateDir}"/>
            <div class="layui-form-item" th:if="${evaluateDir}=='0'">
                <span style="color: red;">确认卖家已如实送达拍品？</span>
            </div>
            <div class="layui-form-item" th:if="${evaluateDir}=='1'">
                <span style="color: red;">确认买家已如实支付货款？</span>
            </div>
            <div class="layui-form-item layui-form-text">
                <label for="evaluateContent" class="layui-form-label">评价内容</label>
                <div class="layui-input-block">
                    <textarea placeholder="请输入评价内容" id="evaluateContent" name="evaluateContent" class="layui-textarea"></textarea>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">
                </label>
                <button  class="layui-btn" lay-filter="add" lay-submit="">
                    确认评价
                </button>
            </div>
        </form>
    </div>
</div>
<script th:inline="none">
    layui.use(['form','jquery','validate','tool'], function(){
        var form = layui.form;
        var $ = layui.jquery;
        var validate = layui.validate;
        var tool = layui.tool;
        var baseUrl = "/back/orderEvaluate";

        //添加表单校验
        form.verify(validate);

        //监听提交
        form.on('submit(add)', function(data){
            var res = tool.submit(baseUrl + '/add',data.field);
            if(res.code == return_200){
                layer.msg(res.msg, {
                        icon: msg.success,
                        time: 2000
                    },
                    function(){
                        xadmin.father_reload();
                    }
                );
            }else {
                layer.msg(res.msg, {
                        icon: msg.error,
                        time: 2000
                    },
                    function(){
                        xadmin.father_reload();
                    }
                );
            }
            return false;
        });
        
    });
</script>
</body>
</html>